:: 启动code, 并自动打开当前文件夹
chcp 65001
goto start
:: @author mmbro
:: @since 2023-12-30 17:51:49
:: @see <a href="https://blog.csdn.net/tsvico/article/details/78050884">win7/10中以管理员身份运行bat脚本时，获取当前文件所在目录</a>

:start
@echo off
set oldPath=%cd%
set codeDir="D:\soft\Microsoft VS Code\"
set codePath=code.exe
title "正在启动VsCode, 路径[%codePath%]"
cd /d %~dp0
cd %codeDir%
start %codePath% %oldPath%


goto restorePath
:: 返回运行本脚本之前的目录
:restorePath
cd /d %oldPath%